3.1.3 \(\int \frac {\sin ^2(x)}{a+a \cos (x)} \, dx\) [3]

Optimal. Leaf size=13 \[ \frac {x}{a}-\frac {\sin (x)}{a} \]

[Out]

x/a-sin(x)/a

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2761, 8} \begin {gather*} \frac {x}{a}-\frac {\sin (x)}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[x]^2/(a + a*Cos[x]),x]

[Out]

x/a - Sin[x]/a

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2761

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g*((g*Cos[e
 + f*x])^(p - 1)/(b*f*(p - 1))), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rubi steps

\begin {align*} \int \frac {\sin ^2(x)}{a+a \cos (x)} \, dx &=-\frac {\sin (x)}{a}+\frac {\int 1 \, dx}{a}\\ &=\frac {x}{a}-\frac {\sin (x)}{a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 17, normalized size = 1.31 \begin {gather*} \frac {2 \left (\frac {x}{2}-\frac {\sin (x)}{2}\right )}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]^2/(a + a*Cos[x]),x]

[Out]

(2*(x/2 - Sin[x]/2))/a

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(29\) vs. \(2(13)=26\).
time = 0.06, size = 30, normalized size = 2.31

method result size
risch \(\frac {x}{a}-\frac {\sin \left (x \right )}{a}\) \(14\)
default \(\frac {-\frac {2 \tan \left (\frac {x}{2}\right )}{\tan ^{2}\left (\frac {x}{2}\right )+1}+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) \(30\)
norman \(\frac {\frac {x}{a}+\frac {x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{a}-\frac {2 \tan \left (\frac {x}{2}\right )}{a}-\frac {2 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}+\frac {2 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{a}}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}\) \(61\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^2/(a+a*cos(x)),x,method=_RETURNVERBOSE)

[Out]

4/a*(-1/2*tan(1/2*x)/(tan(1/2*x)^2+1)+1/2*arctan(tan(1/2*x)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (13) = 26\).
time = 0.51, size = 42, normalized size = 3.23 \begin {gather*} \frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (x\right )}{{\left (a + \frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="maxima")

[Out]

2*arctan(sin(x)/(cos(x) + 1))/a - 2*sin(x)/((a + a*sin(x)^2/(cos(x) + 1)^2)*(cos(x) + 1))

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 10, normalized size = 0.77 \begin {gather*} \frac {x - \sin \left (x\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="fricas")

[Out]

(x - sin(x))/a

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (7) = 14\).
time = 0.19, size = 46, normalized size = 3.54 \begin {gather*} \frac {x \tan ^{2}{\left (\frac {x}{2} \right )}}{a \tan ^{2}{\left (\frac {x}{2} \right )} + a} + \frac {x}{a \tan ^{2}{\left (\frac {x}{2} \right )} + a} - \frac {2 \tan {\left (\frac {x}{2} \right )}}{a \tan ^{2}{\left (\frac {x}{2} \right )} + a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)**2/(a+a*cos(x)),x)

[Out]

x*tan(x/2)**2/(a*tan(x/2)**2 + a) + x/(a*tan(x/2)**2 + a) - 2*tan(x/2)/(a*tan(x/2)**2 + a)

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 25, normalized size = 1.92 \begin {gather*} \frac {x}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )} a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="giac")

[Out]

x/a - 2*tan(1/2*x)/((tan(1/2*x)^2 + 1)*a)

________________________________________________________________________________________

Mupad [B]
time = 0.29, size = 10, normalized size = 0.77 \begin {gather*} \frac {x-\sin \left (x\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^2/(a + a*cos(x)),x)

[Out]

(x - sin(x))/a

________________________________________________________________________________________